﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using PWS;

namespace Api.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class InterviewController : ControllerBase
    {
        private readonly ApiDBContext? db;
        public lnterviweController(ApiDBContext _db)
        {
            db = _db;
        }

        [HttpGet("GetAll")]
        public List<Employee> GetAll()
        {
            List<Employee> employee = new List<Employee>();
            employee = db.lnterviwe.ToList();
            return employee;
        }
        [HttpGet("GetByPostion")]
        public List<Employee> GetByPostion()
        {
            List<Employee> employee = new List<Employee>();
            employee = db.lnterviwe.Where(w => w.Postion == 1).ToList();
            return employee;
        }
    }
}
